package phapp.model.luckstar;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;

/**
 * Title: t_stardeal_data 数据类 POJO Description: DAO层映射到数据类,页面封装数据映射到数据类
 * Copyright: Copyright (c) 2012-10 Company:
 * 
 * @author you name
 * @version 1.0
 */

public class Stardeal extends BaseEntity
{
   public static final int DEAL_TYPE_FREE = 0;
   public static final int DEAL_TYPE_BUY = 1;
   public static final int DEAL_TYPE_PRAISE = 2;   //点赞
   public static final int DEAL_TYPE_SHAREBONUS = 3;   //分享
   public static final int DEAL_TYPE_EVERYLOGIN = 4;   //每天首次登录
   public static final int DEAL_TYPE_USELIGHT = 5;   //放灯
   public static final int DEAL_TYPE_FIRSTLOGIN = 6;   //首次登录
   
   public static final int CUSTOM_FIRSTLOGIN_PRESENT_STAR = 20;   //首次登录赠送20个
   public static final int CUSTOM_SHAREBONUS_PRESENT_STAR = 1;   //每天首次分享赠送1个
   public static final int CUSTOM_EVERYLOGIN_PRESENT_STAR = 1;   //每天首次登录赠送1个
   public static final int CUSTOM_USELIGHT_PRESENT_STAR = 1;   //每天首次放灯赠送1个
   public static final int CUSTOM_PRAISE_PRESENT_STAR = 1;   //点赞赠送1个
   
   // date formats
   public static final String FORMAT_ORDER_DATE = DATE_TIME_FORMAT;

   // columns START
   /** orderId */
   private java.lang.Integer orderId;
   /** 交易方式：0 赠送 1 购买 */
   private java.lang.Integer orderType;
   /** custId */
   private java.lang.Integer custId;
   /** 接收者ID */
   private java.lang.Integer receiverId;
   /** orderCount */
   private java.lang.Integer orderCount;
   /** 金额：分 */
   private java.lang.Integer orderMoney;
   /** orderStatus */
   private java.lang.Integer orderStatus;
   /** 交易说明 */
   private java.lang.String orderNote;
   /** orderDate */
   private java.sql.Timestamp orderDate;

   private java.util.ArrayList idList;

   private java.lang.String custName;
   private java.lang.String receiverName;
   // columns END

   public Stardeal()
   {
   }

   public java.lang.String getCustName()
   {
      return custName;
   }

   public void setCustName(java.lang.String custName)
   {
      this.custName = custName;
   }

   public java.lang.String getReceiverName()
   {
      return receiverName;
   }

   public void setReceiverName(java.lang.String receiverName)
   {
      this.receiverName = receiverName;
   }

   public Stardeal(java.lang.Integer orderId)
   {
      this.orderId = orderId;
   }

   public void setId(java.lang.Integer value)
   {
      this.orderId = value;
   }

   public java.lang.Integer getId()
   {
      return this.orderId;
   }
   
   public void setOrderId(java.lang.Integer value)
   {
      this.orderId = value;
   }

   public java.lang.Integer getOrderId()
   {
      return this.orderId;
   }

   public void setOrderType(java.lang.Integer value)
   {
      this.orderType = value;
   }

   public java.lang.Integer getOrderType()
   {
      return this.orderType;
   }

   public void setCustId(java.lang.Integer value)
   {
      this.custId = value;
   }

   public java.lang.Integer getCustId()
   {
      return this.custId;
   }

   public void setReceiverId(java.lang.Integer value)
   {
      this.receiverId = value;
   }

   public java.lang.Integer getReceiverId()
   {
      return this.receiverId;
   }

   public void setOrderCount(java.lang.Integer value)
   {
      this.orderCount = value;
   }

   public java.lang.Integer getOrderCount()
   {
      return this.orderCount;
   }

   public void setOrderMoney(java.lang.Integer value)
   {
      this.orderMoney = value;
   }

   public java.lang.Integer getOrderMoney()
   {
      return this.orderMoney;
   }

   public void setOrderStatus(java.lang.Integer value)
   {
      this.orderStatus = value;
   }

   public java.lang.Integer getOrderStatus()
   {
      return this.orderStatus;
   }

   public void setOrderNote(java.lang.String value)
   {
      this.orderNote = value;
   }

   public java.lang.String getOrderNote()
   {
      return this.orderNote;
   }

   public String getOrderDateString()
   {
      return date2String(getOrderDate(), FORMAT_ORDER_DATE);
   }

   public void setOrderDateString(String value)
   {
      setOrderDate(string2Date(value, FORMAT_ORDER_DATE, java.sql.Timestamp.class));
   }

   public void setOrderDate(java.sql.Timestamp value)
   {
      this.orderDate = value;
   }

   public java.sql.Timestamp getOrderDate()
   {
      return this.orderDate;
   }

   public java.util.ArrayList getIdList()
   {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList)
   {
      this.idList = idList;
   }

   /** 手动增加属性后,toString,hashCode,equals都要修改 */
   public String toString()
   {
      return new ToStringBuilder(this).append("OrderId", getOrderId()).append("OrderType", getOrderType()).append("CustId", getCustId()).append("receiverId", getReceiverId()).append("OrderCount", getOrderCount()).append("OrderMoney", getOrderMoney())
               .append("OrderStatus", getOrderStatus()).append("OrderNote", getOrderNote()).append("OrderDate", getOrderDate()).toString();
   }

   public int hashCode()
   {
      return new HashCodeBuilder().append(getOrderId()).append(getOrderType()).append(getCustId()).append(getReceiverId()).append(getOrderCount()).append(getOrderMoney()).append(getOrderStatus()).append(getOrderNote()).append(getOrderDate()).toHashCode();
   }

   public boolean equals(Object obj)
   {
      if (obj instanceof Stardeal == false) return false;
      if (this == obj) return true;
      Stardeal other = (Stardeal) obj;
      return new EqualsBuilder().append(getOrderId(), other.getOrderId()).append(getOrderType(), other.getOrderType()).append(getCustId(), other.getCustId()).append(getReceiverId(), other.getReceiverId()).append(getOrderCount(), other.getOrderCount())
               .append(getOrderMoney(), other.getOrderMoney()).append(getOrderStatus(), other.getOrderStatus()).append(getOrderNote(), other.getOrderNote()).append(getOrderDate(), other.getOrderDate()).isEquals();
   }
}
